package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import action.action;
import actionform.myform;

/**
 * Servlet implementation class httpServlet
 */
public class httpServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		 String sign=request.getParameter("sign");	
		 Object o= fullform.instance(sign, request);
		 myform f=(myform)o;
		 String actionName=ActionMap.init().get(request.getParameter("sign"));
		 action action = null;
		try {
			Class clazz = Class.forName(actionName);
			action=(action)clazz.newInstance();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		action.excute(f);
		 
		
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		 this.doGet(request, response);
	}

}
